import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Notfound from '../views/Notfound.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect:'/first',
    children:[
        {
            path:'/first',
            name:'First',
            component: () => import('../views/homechild/First.vue')
        },
        {
            path:'/productOne',
            name:'ProductOne',
            component: () => import('../views/homechild/ProductOne.vue')
        },
        {
            path:'/productTwo',
            name:'ProductTwo',
            component: () => import('../views/homechild/ProductTwo.vue')
        },
        {
            path:'/productThree',
            name:'ProductThree',
            component: () => import('../views/homechild/ProductThree.vue')
        },
        {
            path:'/health',
            name:'Health',
            component: () => import('../views/homechild/Health.vue')
        },
        {
            path:'/coporation',
            name:'Coporation',
            component: () => import('../views/homechild/Coporation.vue')
        },
        {
            path:'/about',
            name:'About',
            component: () => import('../views/homechild/About.vue')
        }
    ]
  },
  {
      path:'/notfound',
      name:'Notfound',
      component:Notfound
  },
  {
    path:'*',
    redirect:'/notfound',
}
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
